package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.OrderOperationRecord;
import com.micro.modual.model.bo.orderoperationrecord.OrderOperationRecordBO;

/**
 * <h1>订单操作记录表 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:26
 */
public class OrderOperationRecordExtension {

    /**
     * <h2>转换: 订单操作记录表 新增</h2>
     *
     * @param orderOperationRecordBO {@link OrderOperationRecordBO} 订单操作记录表 新增/修改 请求对象
     * @return {@link OrderOperationRecord} 订单操作记录表
     */
    public static OrderOperationRecord converAddOrderOperationRecord(OrderOperationRecordBO orderOperationRecordBO) {
        OrderOperationRecord orderOperationRecord = new OrderOperationRecord();
        orderOperationRecord.setId(SnowFlakeUtil.getId());
        orderOperationRecord.setOrderCode(orderOperationRecordBO.getOrderCode());
        orderOperationRecord.setOperationCode(orderOperationRecordBO.getOperationCode());
        orderOperationRecord.setOperationName(orderOperationRecordBO.getOperationName());
        orderOperationRecord.setOperationContent(orderOperationRecordBO.getOperationContent());
        orderOperationRecord.setOrderStatus(orderOperationRecordBO.getOrderStatus());
        orderOperationRecord.setOperationTime(orderOperationRecordBO.getOperationTime());
        return orderOperationRecord;
    }

    /**
     * <h2>转换: 订单操作记录表 修改</h2>
     *
     * @param orderOperationRecordBO {@link OrderOperationRecordBO} 订单操作记录表 新增/修改 请求对象
     * @return {@link OrderOperationRecord} 订单操作记录表
     */
    public static OrderOperationRecord converEditOrderOperationRecord(OrderOperationRecordBO orderOperationRecordBO) {
        OrderOperationRecord orderOperationRecord = new OrderOperationRecord();
        orderOperationRecord.setId(orderOperationRecordBO.getId());
        orderOperationRecord.setOrderCode(orderOperationRecordBO.getOrderCode());
        orderOperationRecord.setOperationCode(orderOperationRecordBO.getOperationCode());
        orderOperationRecord.setOperationName(orderOperationRecordBO.getOperationName());
        orderOperationRecord.setOperationContent(orderOperationRecordBO.getOperationContent());
        orderOperationRecord.setOrderStatus(orderOperationRecordBO.getOrderStatus());
        orderOperationRecord.setOperationTime(orderOperationRecordBO.getOperationTime());
        return orderOperationRecord;
    }
}
